#include "BCIMatrix.h"

BCIMatrix::BCIMatrix(int Rows,int Cols)
{
	
	cols	=	Cols;
	rows	=	Rows;
	esize	=	sizeof(float32);

	pFloat	=	new float[Rows*Cols];
	pdata	=	pFloat;
	memset(pdata,0,sizeof(float)*cols*rows);
}

BCIMatrix::~BCIMatrix(void)
{
	delete [] pFloat;
	pdata	=	NULL;
	cols	=	rows	=	esize	=	0;
}

void	BCIMatrix::SetValue(unsigned int Row,unsigned int Col,float Value)
{
	if(rows <= Row || cols <= Col)wxMessageBox(_T("BCIMatrix::SetValue Coodinates outside matrix boundaries"));
	pFloat[Col*rows+Row]=Value;
}
float	BCIMatrix::GetValue(unsigned int Row,unsigned int Col)
{
	if(rows <= Row || cols <= Col) wxMessageBox(_T("BCIMatrix::GetValue Coodinates outside matrix boundaries"));
	return pFloat[Col*rows+Row];
}

void	BCIMatrix::Zero(void)
{
	memset(pdata,0,sizeof(float)*cols*rows);
}